function createCompareFunction (prototypeName) {
  return function (object1, object2) {
    var value1 = object1[prototypeName]
    var value2 = object2[prototypeName]
    if (value1 < value2) {
      return -1
    } else if (value1 > value2) {
      return 1
    } else {
      return 0
    }
  }
}
// 这个也是个闭包
var a
function outer () {
  var ou = 0
   a = function (){
     console.log('ou', ou)
    ou = ou + 1
  }
}
outer()
a() // 0
a() // 1
